<?php

function provocation_add($administratorId, $message, $time, $pages, $url) {
  $data = array(
    'time'            => $time, 
    'pages'           => $pages,
    'url'             => $url,
    'administratorId' => $administratorId, 
    'message'         => $message,
  );
  $id = database_insert('provocations', $data);
  return $id;
}

function provocation_get_all() {
  $account  = operators_get_account();
  $query    = "SELECT * FROM `provocations` WHERE `administratorId` = {$account["administratorId"]}";
  $data     = database_get_assoc($query);
  return $data;
}

function provocation_remove($id) {
  database_remove('provocations', $id);
}
